package com.yanqu.road.server.cmd.activity.union.task;

import com.yanqu.road.pb.union.cross.CrossUnionActivityTaskProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.UnionActivityTaskMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_UNION_ACTIVITY_TASK_GET_DATA_FROM_CROSS, desc = "跨服获取商会任务进度")
public class GetUnionActivityTaskFromCrossCmd extends AbstractCommand {

    private CrossUnionActivityTaskProto.SyncUnionActivityTaskMsg msg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        msg = CrossUnionActivityTaskProto.SyncUnionActivityTaskMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        UnionActivityTaskMgr.updateOnlinePlayerData(player, msg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
